import http from "@/utils/http.js";

//获取门店列表
export const storeList = (data) => {
    return http.get(`/applet/agent/store/list`,data);
};
  
//代理端登录
export const agentLogin = (data) => {
  return http.post(`/applet/agent/agentLogin`, data);
};


//商户端登录
export const merchantLogin = (data) => {
  return http.post(`/applet/agent/merchantLogin`, data);
};


//根据id获取门店详情
export const storeQueryById = (data) => {
    return http.get(`/applet/agent/store/queryById`,data);
};
  
//新增门店
export const storeAdd = (data) => {
    return http.post(`/applet/agent/store/add`,data);
};
  
//修改门店
export const storeUpdate = (data) => {
    return http.post(`/applet/agent/store/update`,data);
};
  
//删除门店
export const storeDelete = (data) => {
    return http.delete(`/applet/agent/store/${data}`);
};
//获取商户列表
export const merchantList = (data) => {
    return http.get(`/applet/agent/merchant/list`,data);
};
  

//根据id获取商户详情
export const merchantQueryById = (data) => {
    return http.get(`/applet/agent/merchant/queryById`,data);
};
  
//新增商户
export const merchantAdd = (data) => {
    return http.post(`/applet/agent/merchant/add`,data);
};
//修改商户
export const merchantUpdate = (data) => {
    return http.post(`/applet/agent/merchant/update`,data);
};
//删除商户
export const merchantDelete = (data) => {
    return http.get(`/applet/agent/merchant/delete`,data);
};

//新增商户-获取门店列表

export const listForMerchantOfAdd = (data) => {
    return http.get(`/applet/agent/merchant/listForMerchantOfAdd`,data);
};

//修改商户-获取门店列表
export const listForMerchantOfUpdate = (data) => {
    return http.get(`/applet/agent/merchant/listForMerchantOfUpdate`,data);
};

//修改商户-获取已关联的门店列表
export const getStoreIdByMerchantId = (data) => {
    return http.get(`/applet/agent/merchant/getStoreIdByMerchantId`,data);
};


//获取合作伙伴列表
export const cooperativePartnerList = (data) => {
    return http.get(`/applet/agent/cooperativePartner/list`,data);
};
  

//根据id获取合作伙伴详情
export const cooperativePartnerQueryById = (data) => {
    return http.get(`/applet/agent/cooperativePartner/queryById`,data);
};
  
//新增合作伙伴
export const cooperativePartnerAdd = (data) => {
    return http.post(`/applet/agent/cooperativePartner/add`,data);
};
//修改合作伙伴
export const cooperativePartnerUpdate = (data) => {
    return http.post(`/applet/agent/cooperativePartner/update`,data);
};
//删除合作伙伴
export const cooperativePartnerDelete = (data) => {
    return http.get(`/applet/agent/cooperativePartner/delete`,data);
};



//获取设备列表
export const deviceList = (data) => {
    return http.get(`/applet/agent/device/list`,data);
};
  

//根据id获取设备详情
export const deviceQueryById = (data) => {
    return http.get(`/applet/agent/device/queryById`,data);
};
  
//新增设备
export const deviceAdd = (data) => {
    return http.post(`/applet/agent/device/add`,data);
};
//修改设备
export const deviceUpdate = (data) => {
    return http.post(`/applet/agent/device/update`,data);
};
//删除设备
export const deviceDelete = (data) => {
    return http.delete(`/applet/agent/device/${data}`);
};


//获取所有门店
export const allStoreList = (data) => {
    return http.get(`/applet/agent/store/allStoreList`,data);
};

//获取提现列表
export const withdrawalList = (data) => {
    return http.get(`/applet/agent/withdrawal/detailsList`,data);
};


//获取提现审核列表
export const withdrawalReviewList = (data) => {
    return http.get(`/applet/agent/withdrawal/reviewList`,data);
};



//到账统计
export const receiptStatistics = (data) => {
    return http.get(`/applet/agent/withdrawal/receiptStatistics`,data);
};


//通过、驳回提现状态
export const changeStatus = (data) => {
    return http.post(`/applet/agent/withdrawal/changeStatus`,data);
};


//修改密码
export const agentAndPartnerCommonUpdatePwd = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/updatePwd`,data);
};

//修改商户状态
export const agentAndPartnerCommonChangeStatus = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/changeStatus`,data);
};

//修改商户提现状态
export const agentAndPartnerCommonChangeIsWithdrawal = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/changeIsWithdrawal`,data);
};

//扣除商户余额
export const agentAndPartnerCommonDeductBalance = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/deductBalance`,data);
};

//重置商户密码
export const agentAndPartnerCommonResetPwd = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/resetPwd`,data);
};

//商家转账-商户单号查询转账单
export const getTransferDetailByOutNo = (data) => {
    return http.get(`/applet/agent/withdrawal/getTransferDetailByOutNo`,data);
};




//提现
export const withdrawal = (data) => {
    return http.get(`/applet/agent/withdrawal/withdrawal`,data);
};



//提现申请提交
export const withdrawalAdd = (data) => {
    return http.post(`/applet/agent/withdrawal/add`,data);
};

//获取代理余额和提现费率的接口
export const getBalanceAndWithdrawalRate = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/getBalanceAndWithdrawalRate`,data);
};


//获取代理数据统计接口
export const getDataOverviewForAgent = (data) => {
    return http.get(`/applet/agentAndPartnerCommon/getDataOverviewForAgent`,data);
};




//获取商户数据统计接口
export const getDataOverviewForMerchant = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/getDataOverviewForMerchant`,data);
};


//获取盟友统计接口
export const getDataOverviewForPartner = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/getDataOverviewForPartner`,data);
};
//订单列表
export const orderList = (data) => {
    return http.get(`/applet/agent/order/list`,data);
};

//获取代理权限
export const agentGetUserInfo = (data) => {
    return http.get(`/applet/agent/getUserInfo`,data);
};


//获取代理设备类型数量
export const deviceCardData = (data) => {
    return http.get(`/applet/agent/device/cardData`,data);
};


//代理商收益统计接口
export const mySummaryOfAmountForAgent = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/income/mySummaryOfAmountForAgent`,data);
};


//合作伙伴收益统计接口
export const mySummaryOfAmountForPartner = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/income/mySummaryOfAmountForPartner`,data);
};


//商户收益统计接口
export const merchantSummaryOfAmount = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/income/merchantSummaryOfAmount`,data);
};



//代理使用的商户收益统计接口
export const merchantSummaryOfQuery = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/income/merchantSummaryOfQuery`,data);
};

//收益明细列表
export const incomeList = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/income/list`,data);
};


//根据id查合作伙伴数据概览
export const getDataOverviewForPartnerById = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/getDataOverviewForPartnerById`,data);
};

//获取上级联系方式
export const getManagerPhone = (data) => {
  return http.get(`/applet/agent/merchant/getManagerPhone`,data);
};


//获取门店收益统计
export const storeOrderAmountSummary = (data) => {
  return http.get(`/applet/agentAndPartnerCommon/income/storeOrderAmountSummary`,data);
};
